package com.example.a22310.myapplication.Activity;

//红色的R解决不了
import android.content.Context;
import android.content.SharedPreferences;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.example.a22310.myapplication.ViewModel.Prize.PrizeViewModel;
import com.example.a22310.myapplication.databinding.ActivityPrizeBinding;

public class PrizeActivity extends AppCompatActivity {
    private String FILENAME = "yuejian'data";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityPrizeBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_prize);
        new PrizeViewModel(this,binding,getUserid());
    }

    private int  getUserid(){
        int newsNumber;
        SharedPreferences sharedPreferences = getSharedPreferences(FILENAME, Context.MODE_PRIVATE);
        newsNumber = sharedPreferences.getInt("userId",0);
        return newsNumber;
    }
}
